home *** CD-ROM | disk | FTP | other *** search
- import java.awt.Graphics;
-
- class ClickArea extends ImageMapArea {
- int startx;
- int starty;
-
- public void handleArg(String arg) {
- super.terminal = false;
- }
-
- public void highlight(Graphics g, boolean on) {
- }
-
- String ptstr(int x, int y) {
- return "(" + x + ", " + y + ")";
- }
-
- public void press(int x, int y) {
- ((ImageMapArea)this).showStatus("Clicked at " + this.ptstr(x, y));
- this.startx = x;
- this.starty = y;
- }
-
- public void drag(int x, int y) {
- ((ImageMapArea)this).showStatus("Rectangle from " + this.ptstr(this.startx, this.starty) + " to " + this.ptstr(x, y) + " is " + (x - this.startx) + "x" + (y - this.starty));
- }
-
- public void lift(int x, int y) {
- this.drag(x, y);
- }
-
- public ClickArea() {
- }
- }
-